<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<div id="app">
  <cpn-script></cpn-script>
  <cpn-script></cpn-script>
  <cpn-script></cpn-script>
  <cpn-template></cpn-template>
  <cpn-template></cpn-template>
  <cpn-template></cpn-template>
</div>

<!-- 1. 通过script标签，但是类型必须是text/x-template -->
<script id="myCpnScript" type="text/x-template">
  <div>
    <h2>我是标题-script</h2>
    <p>我是内容, 哈哈哈</p>
  </div>
</script>

<!-- 2. template标签 -->
<template id="myCpnTemplate">
  <div>
    <h2>我是标题-template</h2>
    <p>我是内容, 哈哈哈</p>
  </div>
</template>


<script src="../js/vue.js"></script>
<script>
  //1. 注册一个全局组件。
  Vue.component('cpn-script', {
      template: '#myCpnScript'
    }
  );
  Vue.component('cpn-template', {
      template: '#myCpnTemplate'
    }
  );

  const app = new Vue({
    el: '#app',
    data: {
      message: 'Rae是我儿子！'
    }
  })
</script>

</body>
</html>